<!--
 * @Author: kael kael@uii.net
 * @Date: 2023-05-29 22:48:32
 * @LastEditors: kael kael@uii.net
 * @LastEditTime: 2023-06-06 00:02:35
 * @FilePath: \UiiWenJuanAdmin\src\components\common\BasePhoto.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div class="base-photo">
    <ul class="photo-list">
      <template v-for="p in props.photoList">
        <li class="mt-10 mb-10" v-if="p.Required !== 1">
          <div
            class="cl-primary mb-10"
            :class="p.Required === 3 ? 'required' : ''"
          >
            {{ p.PhotoName }}
          </div>

          <BaseUpload
            multiple
            accept=".jpeg, .jpg"
            list-type="image-card"
            :disabled="props.disabled"
            :max="p.PhotoMax"
            @increment="emit('increment')"
            @decrement="emit('decrement')"
            v-model:value="p.urls"
          ></BaseUpload>
        </li>
      </template>
    </ul>
  </div>
</template>

<script setup>
const props = defineProps(['value', 'photoList', 'disabled'])
const emit = defineEmits(['update:value', 'increment', 'decrement'])

defineExpose({})
</script>

<style lang="scss" scoped></style>
